/*
 * Filename ProjectMapping.java 2022年07月21日
 * Copyright © Ehome Co.Ltd. All Rgiths Reserved.
 * @author wuyingchao
 */
package com.ehome.poct.core.service.mapping;

import com.ehome.poct.core.api.dto.check.CheckProjectDTO;
import com.ehome.poct.core.api.dto.check.gold.TestConfPoctStripTypeDTO;
import com.ehome.poct.core.api.dto.check.project.EhomeProjectDTO;
import io.swagger.annotations.ApiModelProperty;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author wyc
 * @since 2022/07/21 16:09
 **/
@Mapper(componentModel = "spring")
public interface CheckProjectMapping {
    List<EhomeProjectDTO> toFromGold(List<TestConfPoctStripTypeDTO> golds);

    @Mapping(target = "code", source = "typeCode")
    @Mapping(target = "checkType",constant = "1")
    EhomeProjectDTO to(TestConfPoctStripTypeDTO gold);

    List<EhomeProjectDTO> toFromBld(List<CheckProjectDTO> bloods);

    @Mapping(target = "code", source = "checkProjectCode")
    @Mapping(target = "name", source = "checkProjectName")
    @Mapping(target = "description", source = "projectDesc")
    @Mapping(target = "imgUrl", source = "projectIcon")
    @Mapping(target = "price",source = "salePrice")
    @Mapping(target = "checkType",source = "type")
    @Mapping(target = "testConfPoctStripTypeId",source = "bloodCheckProjectId")
    EhomeProjectDTO to(CheckProjectDTO blood);

}